#include<func.h>
int main()
{
    pid_t pid;
    pid=fork();
    if(pid<0)
    {
        printf("fork error");
    }
    else if(0==pid)
    {
        printf("i am child,my pid is %d,ppid=%d\n",getpid(),getppid()); 
        while(1);
    }
    else
    {
        printf("i am parent,my child pid is%d,my pid is %d,ppid=%d\n",pid,getpid(),getppid());
        sleep(1);
        return 0;
        
    }
}